The foreign-type tells the compiler how to interpret a T data type in order to pass it to the foreign call. The general categories of Pascal data types are numeric, string, record, enumerated, set of.
Pascal Type | T3 Type | Foreign Type Spec | |
Numeric | |||
integer8 | fixnum | rep/integer-8-s | |
binteger | fixnum | rep/integer-8-u | |
integer16 | fixnum | rep/integer-16-s | |
pinteger | fixnum | rep/integer-16-u | |
integer | fixnum | rep/integer | |
linteger | fixnum | rep/integer | |
real | unimplemented | ||
double | flonum | rep/extend | |
String | |||
string | string | rep/string | |
string | text | rep/extend | |
univ_pointer | string | rep/string-pointer | |
univ_pointer | text | rep/extend-pointer | |
Record | |||
record | extend | rep/extend | |
Miscellaneous | |||
char | char | rep/char | |
boolean | boolean | rep/integer-8-s |
Beware that if a T string is being used as an out parameter the offset field of the string must be 0 (the string must never have been chdr!'ed).
Record structures are represented by byte-vectors of the appropriate size.